package com.example.shop.persistence.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 商品分类表
 * </p>
 *
 * @author jason
 * @since 2019-12-16
 */
@TableName("shop_goods_type")
public class GoodsType extends Model<GoodsType> {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value="商品分类ID",example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 分类名称
     */
    private String typeName;

    /**
     * 父级ID
     */
    @TableField("parentID")
    private Integer parentID;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public Integer getParentID(){return parentID;}

    public void setParentID(Integer parentID){this.parentID = parentID;}

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "GoodsType{" +
                "id=" + id +
                ", typeName=" + typeName +
                ", parentID=" + parentID +
                "}";
    }
}
